package thread;

public class CurrentThreadDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();
        System.out.println("主线程:" + main);
        doSome();

        Thread t = new Thread(){
            public void run() {
                System.out.println(Thread.currentThread());
                doSome();
            }
        };
        t.start();
    }

    public static void doSome() {
        Thread t = Thread.currentThread();
        System.out.println("运行此方法的线程:" + t);
    }
}
